package com.ht.module.bus.service;

import cn.hutool.core.lang.tree.Tree;
import com.ht.module.bus.entity.TDistrict;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ht.util.Pager;

import java.util.List;

/**
 * <p>
 * 区划表 服务类
 * </p>
 *
 * @author hejialun
 * @since 2024-07-29
 */
public interface TDistrictService extends IService<TDistrict> {

    /**
     * 查询区划树
     * @param en
     * @param TopNodeCode：自定义顶级节点
     * @return
     */
    List<Tree<String>> findTree(TDistrict en,String TopNodeCode);

    void add(TDistrict en);

    Pager<TDistrict> findPage(Pager<TDistrict> pager, TDistrict en);

    void editById(TDistrict en);

    List<Tree<String>> findTreeAuth(TDistrict en);

    List<TDistrict> findListAuth(TDistrict en);

    List<TDistrict> findAll();

    /**
     * 获取当前区划的所有子集区划
     * @param code
     * @return
     */
    List<String> getSonList(String code);

    void delById(String id);

    void collectNodeIds(Tree<String> tree, List<String> nodeIdList);


}
